From 42a121dbf8b65d6ba4e9b69621fae272e2e82395 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Thu, 12 Apr 2007 08:11:27 +0000 Subject: [PATCH] [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): Use GetGlobalMouse instead of GetMouse and LocalToGlobal. (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero. (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and dpyinfo->width are those of whole screen. --- src/macterm.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/macterm.c b/src/macterm.c index e377d352476..9d190a3e4f6 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -10533,8 +10533,7 @@ mac_post_mouse_moved_event () { Point mouse_pos; - GetMouse (&mouse_pos); - LocalToGlobal (&mouse_pos); + GetGlobalMouse (&mouse_pos); err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint, sizeof (Point), &mouse_pos); } @@ -11554,7 +11553,7 @@ mac_initialize_display_info () } if (err == noErr) { - CGRect bounds = CGRectMake (0, 0, 0, 0); + CGRect bounds = CGRectZero; while (ndisps-- > 0) bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); @@ -11569,15 +11568,21 @@ mac_initialize_display_info () } #else { - GDHandle main_device_handle = LMGetMainDevice(); + GDHandle gdh = GetMainDevice (); + Rect rect = (**gdh).gdRect; - dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); + dpyinfo->color_p = TestDeviceAttribute (gdh, gdDevType); for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) - if (HasDepth (main_device_handle, dpyinfo->n_planes, - gdDevType, dpyinfo->color_p)) + if (HasDepth (gdh, dpyinfo->n_planes, gdDevType, dpyinfo->color_p)) break; - dpyinfo->height = (**main_device_handle).gdRect.bottom; - dpyinfo->width = (**main_device_handle).gdRect.right; + + for (gdh = GetDeviceList (); gdh; gdh = GetNextDevice (gdh)) + if (TestDeviceAttribute (gdh, screenDevice) + && TestDeviceAttribute (gdh, screenActive)) + UnionRect (&rect, &(**gdh).gdRect, &rect); + + dpyinfo->height = rect.bottom - rect.top; + dpyinfo->width = rect.right - rect.left; } #endif dpyinfo->grabbed = 0; -- 2.30.2